﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="x-green-navbar">
    <div class="container">
        <ul class="nav x-green-nav">
            <c:forEach var="menu" items="${secure.menus}">
                <c:if test="${currentPrincipal.hasResource('menus', menu.id)}">
                    <c:if test="${menuContext.shouldHighlight(menu.id)}"><c:set value="${menu.id}" var="activeMenu" scope="request" /></c:if>
                    <li ${menuContext.shouldHighlight(menu.id) ? 'class="open"' : ''}><a href="${ctx.host}/${menu.url}">${menu.name}</a></li>
                </c:if>
            </c:forEach>
        </ul>
    </div>
</div>
